import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;
import java.util.regex.Pattern;

public class Main{

    private static Scanner cin = null;

    static {
        try {
            cin = new Scanner(new FileReader(new File("B.in")));
        } catch (FileNotFoundException e) {
            cin = new Scanner(System.in);
        }
    }

    //Ctrl+Alt+L
    //Ctrl+D  ^D EOF
    public static void main(String[] args) {
        int T = Integer.valueOf(cin.nextLine());
        final String regex = "^[a-zA-Z_][a-zA-Z0-9_]*$";
        while (T-- > 0) {
            String str = cin.nextLine();
            if (Pattern.matches(regex, str)) {
                System.out.println("yes");

            } else {
                System.out.println("no");
            }
        }
    }
}